Skip to content

Update IExtraMetadataWriter.setExtraMetadata(...) to accept an Object#4243

Open
melissalinkert wants to merge 1 commit intoome:developfrom
melissalinkert:extra-metadata-api-extension
Open

Update IExtraMetadataWriter.setExtraMetadata(...) to accept an Object#4243
melissalinkert wants to merge 1 commit intoome:developfrom
melissalinkert:extra-metadata-api-extension

Conversation

@melissalinkert
Copy link
Member

If an ITagProvider is passed to this method when called on DicomWriter, the ITagProvider is directly added to the tag provider list. If a String is passed instead, then it is assumed to be a path to a file that can be parsed by DicomJSONProvider (as before).

Drafting for consideration in 8.0.0. @ebremer, is this sufficient to cover what you had in mind for #4169? If not, concrete suggestions and/or a more complete description of the use case that needs to be considered would be very helpful.

Any writers that implement IExtraMetadataWriter in the future then have flexibility in what they accept in setExtraMetadata(...). I don't know if this ends up being too flexible though.

I did test briefly with this and still got the expected output file contents:

$ cat hierarchy-test.json 
{
   "BodyPartExamined": {
     "Value": "BRAIN",
     "VR": "CS",
     "Tag": "(0018,0015)"
   },
   "SpecimenLabelInImage": {
      "Value": "NO",
      "VR": "CS",
      "Tag": "(0048,0010)",
      "ReplacementStrategy": "IGNORE"
   },
   "ContributingEquipmentSequence": {
     "VR": "SQ",
     "Tag": "(0018,a001)",
     "Sequence": {
       "Manufacturer": {
         "Value": "PixelMed",
         "VR": "LO",
         "Tag": "(0008,0070)"
       },
       "ContributionDateTime": {
         "Value": "20210710234601.105+0000",
         "VR": "DT",
         "Tag": "(0018,a002)"
       }
     }
   },
   "OpticalPathSequence": {
    "VR": "SQ",
    "Tag": "(0048,0105)",
    "Sequence": {
      "IlluminationTypeCodeSequence": {
        "VR": "SQ",
        "Tag": "(0022,0016)",
        "Sequence": {
          "CodeValue": {
            "VR": "SH",
            "Tag": "(0008,0100)",
            "Value": "111743"
          },
          "CodingSchemeDesignator": {
            "VR": "SH",
            "Tag": "(0008,0102)",
            "Value": "DCM"
          },
          "CodeMeaning": {
            "VR": "LO",
            "Tag": "(0008,0104)",
            "Value": "Epifluorescence illumination"
          }
        }
      },
      "IlluminationWaveLength": {
        "VR": "FL",
        "Tag": "(0022,0055)",
        "Value": "488.0"
      },
      "OpticalPathIdentifier": {
        "VR": "SH",
        "Tag": "(0048,0106)",
        "Value": "1"
      },
      "OpticalPathDescription": {
        "VR": "ST",
        "Tag": "(0048,0107)",
        "Value": "replacement channel"
      }
    },
    "ResolutionStrategy": "REPLACE"
   }
}
$ bfconvert -no-upgrade test.fake wednesday-test.dcm -extra-metadata hierarchy-test.json

If an ITagProvider is passed to this method when called on DicomWriter,
the ITagProvider is directly added to the tag provider list.
If a String is passed instead, then it is assumed to be a path to
a file that can be parsed by DicomJSONProvider (as before).

See ome#4169.
@melissalinkert melissalinkert modified the milestones: 8.0.0, 9.0.0 Sep 25, 2024
@ebremer
Copy link

ebremer commented Sep 30, 2024

It looks good @melissalinkert ! It will allow me to create my own ITagProvider(s). Specifically, one that takes an Apache Jena Model as a constructor parameter. :-)

@melissalinkert melissalinkert marked this pull request as ready for review September 30, 2024 20:26
@melissalinkert melissalinkert modified the milestones: 9.0.0, 8.0.0 Sep 30, 2024
@melissalinkert melissalinkert modified the milestones: 8.0.0, 8.1.0 Oct 21, 2024
@melissalinkert melissalinkert modified the milestones: 8.1.0, 9.0.0 Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants